<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix = "c"  uri = "http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html lang="en-US">
  <head>
    
    
  <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
	<title>凯胜项目管理系统</title>
	<style type="text/css">
		body{
			padding-top:50px;
		}
		.left{
			cursor:pointer;
			display:none;
		}
		
	</style>

  </head>
  
  <body class="body">
	<%@include file="same2.jsp" %>
	<div class="container">
		<div class="row">
			<%@include file="same.jsp" %>
			<div class="span6">
				 <ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:10px">
					<li class="active">
						<i class="icon-th"></i>你在想什么？
					</li>
				</ul>
				<div class="wall" style="border-top:none; border:1px solid #dddddd ;padding-top:20px ">
					<form style="margin-left:15px" action="pro.jspx?qmethod=new" method="post">
						<textarea name="content" id="" style="width:415px" rows="3"></textarea>
						<button class="btn btn-primary">发布</button>
					</form>
				</div>
				 <ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:15px">
					<li class="active">
						<i class="icon-th"></i>信息流
						
					</li>
				</ul>
					<div class="wall " style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:0px;border:1px  solid #dddddd">
					<ul class="nav nav-tabs">
						  <li class="active" style="font-size:12px"><a href="#home" data-toggle="tab">所有动态</a></li>
						  <li style="font-size:12px"><a href="#profile" data-toggle="tab">关于我的</a></li>
					</ul>
					<div class="tab-content">
					  <div class="tab-pane active" id="home">
						<div>
						<c:choose>
							<c:when test="${empty requestScope.messagelist.list}">
								<div>
									<div style="margin-left:20px">该项目还没有任何动态</div>
								</div>
							</c:when>
							<c:otherwise>
									<c:forEach items = "${requestScope.messagelist.list}" var = "message">
										<c:choose>
										<c:when test="${message.type=='document'}">
											<div class="row" style="margin-bottom:10px;border-radius: 3px 3px 0 0;margin-top:0px">						 
											   <div class="span1" OnMouseOver="player('${message.id}');" onMouseOut="clocer('${message.id}');" >
													<div style="margin-left:20px;width:60px">
														<c:choose>
															<c:when test="${empty message.user.imgname}">
																<div class="wall" style="border:grey solid 1px;width:50px"><img src="img/4.png" style="width:60px;height:65px" /></div>
															</c:when>
															<c:otherwise>
																<div class="wall" style="border:grey solid 1px;width:60px"><img src="myimg.jspx?path=${message.user.imgname}" style="width:60px;height:65px" /></div>
				
															</c:otherwise>
														</c:choose>
														  <div class = "left " id="${message.id}" style="width:200px;height:100px;border:1px solid grey;position:absolute;z-index:1;margin-left:40px;margin-top:-30px;background-color:grey"  OnMouseOver="player('${message.id}');" onMouseOut="clocer('${message.id}');">
															<div style="margin-left:2px;width:60px">
																<c:choose>
																	<c:when test="${empty message.user.imgname}">
																		<div class="wall" style="border:grey solid 1px;width:50px"><img src="img/4.png" style="width:60px;height:75px"  /></div>
																	</c:when>
																	<c:otherwise>
																		<div class="wall" style="border:grey solid 1px;width:60px"><img src="myimg.jspx?path=${message.user.imgname}" style="width:60px;height:75px"  /></div>
						
																	</c:otherwise>
																</c:choose>
															</div>
															<div style="margin-left:22px;color:yellow">${message.user.username}</div>
														</div>
													</div>
												</div>
											  <div class="span4">
												<div style="width:370px;border-left:none;word-wrap:break-word">
													<div style="margin-left:8px;margin-right:10px"><span style="color:green;font-size:16px">${message.user.username}</span><span>    分享了资料:</span><a href="document.jspx">  &lt: ${message.name} &gt:  </a><span><a href="document.jspx">${message.content}</a></span></div>
													<div style="margin-left:8px;margin-top:5px"><span style="margin-left:8px">${message.date}</span></div>
													<c:forEach items = "${message.commentlist}" var = "comment">
														<div style="margin-left:15px;margin-top:5px"><span ><i class="icon-user "></i> <a href="#">${comment.userid}</a>:   ${comment.content}</span>  </div>
													</c:forEach>
													
													
													<hr>
												</div>
											  </div>
											</div> 
										</c:when>
										<c:when test="${message.type=='file'}" >
											<div class="row" style="margin-bottom:10px;border-radius: 3px 3px 0 0;margin-top:0px">						 
											   <div class="span1" OnMouseOver="player('${message.id}');" onMouseOut="clocer('${message.id}');" >
													<div style="margin-left:20px;width:60px">
														<c:choose>
															<c:when test="${empty message.user.imgname}">
																<div class="wall" style="border:grey solid 1px;width:50px"><img src="img/4.png" style="width:60px;height:65px"  /></div>
															</c:when>
															<c:otherwise>
																<div class="wall" style="border:grey solid 1px;width:60px"><img src="myimg.jspx?path=${message.user.imgname}" style="width:60px;height:65px"  /></div>
															</c:otherwise>
														</c:choose>
														  <div class = "left " id="${message.id}" style="width:200px;height:100px;border:1px solid grey;position:absolute;z-index:1;margin-left:40px;margin-top:-30px;background-color:grey"  OnMouseOver="player('${message.id}');" onMouseOut="clocer('${message.id}');">
															<div style="margin-left:2px;width:60px">
																<c:choose>
																	<c:when test="${empty message.user.imgname}">
																		<div class="wall" style="border:grey solid 1px;width:50px"><img src="img/4.png" style="width:60px;height:75px" /></div>
																	</c:when>
																	<c:otherwise>
																		<div class="wall" style="border:grey solid 1px;width:60px"><img src="myimg.jspx?path=${message.user.imgname}" style="width:60px;height:75px" /></div>
																	</c:otherwise>
																</c:choose>
															</div>
															<div style="margin-left:22px;color:yellow">${message.user.username}</div>
														</div>
													</div>
												</div>
											  <div class="span4">
												<div style="width:370px;border-left:none;word-wrap:break-word">
													<div style="margin-left:8px;margin-right:10px"><span style="color:green;font-size:16px">${message.user.username}</span><span>    上传了文件:</span><a href="file.jspx">  &lt: ${message.name} &gt:  </a></div>
													<div style="margin-left:8px;margin-top:5px"><span style="margin-left:8px">${message.date}</span></div>	
													<hr>
												</div>
											  </div>
											</div> 
										</c:when>
										<c:when test="${message.type=='infor'}" >
											<div class="row" style="margin-bottom:10px;border-radius: 3px 3px 0 0;margin-top:0px">						 
												<div class="span1" OnMouseOver="player('${message.id}');" onMouseOut="clocer('${message.id}');" >
													<div style="margin-left:20px;width:60px">
														<c:choose>
															<c:when test="${empty message.user.imgname}">
																<div class="wall" style="border:grey solid 1px;width:50px"><img src="img/4.png" style="width:60px;height:65px"  /></div>
															</c:when>
															<c:otherwise>
																<div class="wall" style="border:grey solid 1px;width:60px"><img src="myimg.jspx?path=${message.user.imgname}" style="width:60px;height:65px" /></div>
															</c:otherwise>
														</c:choose>
														  <div class = "left " id="${message.id}" style="width:200px;height:100px;border:1px solid grey;position:absolute;z-index:1;margin-left:40px;margin-top:-30px;background-color:grey"  OnMouseOver="player('${message.id}');" onMouseOut="clocer('${message.id}');">
															<div style="margin-left:2px;width:60px">
															<c:choose>
																<c:when test="${empty message.user.imgname}">
																	<div class="wall" style="border:grey solid 1px;width:50px"><img src="img/4.png" style="width:60px;height:75px"  /></div>
																</c:when>
																<c:otherwise>
																	<div class="wall" style="border:grey solid 1px;width:60px"><img src="myimg.jspx?path=${message.user.imgname}" style="width:60px;height:75px"  /></div>
																</c:otherwise>
															</c:choose>
															</div>
															<div style="margin-left:22px;color:yellow">${message.user.username}</div>
														</div>
													</div>
												</div>
												  <div class="span4" style="margin-bottom:10px">
												  	<div class="mydiv" >
														<div style="width:370px;border-left:none;word-wrap:break-word">
															<div style="margin-left:8px;margin-right:10px"><span style="color:green;font-size:16px">${message.user.username}:</span><span style="margin-left:8px"><a href="#">  ${message.content}</a></span></div>
															<div style="margin-left:8px;margin-top:5px"><span style="margin-left:8px">${message.date}</span></div>	
															<c:forEach items = "${message.commentlist}" var = "comment">
																<div style="margin-left:15px;margin-top:5px"><span ><i class="icon-user "></i> <a href="idea.jspx">${comment.userid}</a>:   ${comment.content}</span>  </div>
															</c:forEach>
															<div class="span1" OnClick="player('${message.content}');"  >
																<div style="width:200px"><a>[我也要评论]</a>   </div>
																<div class = "left " id="${message.content}" style="width:280px;height:100px;border:1px solid white"  OnClick="player('${message.content}');"  >
																	<form class="myform" id="${message.date}"  style="margin-left:5px" action="pro.jspx?qmethod=comment&mid=${message.id}" method="post">
																		<textarea name="desc" id="des" style="width:260px" rows="3" >请输入你的评论....</textarea>
																		<div style="margin-left:195px"><input type="submit"  OnClick="comment('${message.date}');" class="btn" value="发表评论"/></div>
																	</form>
																</div>
															</div>
														</div>
													</div>
													<hr>
												  </div>
											</div>
										</c:when>
										<c:when test="${message.type=='task'}" >
											<div class="row" style="margin-bottom:10px;border-radius: 3px 3px 0 0;margin-top:0px">						 
												<div class="span1" OnMouseOver="player('${message.id}');" onMouseOut="clocer('${message.id}');" >
													<div style="margin-left:20px;width:60px">
														<c:choose>
															<c:when test="${empty message.user.imgname}">
																<div class="wall" style="border:grey solid 1px;width:50px"><img src="img/4.png" style="width:60px;height:65px"  /></div>
															</c:when>
															<c:otherwise>
																<div class="wall" style="border:grey solid 1px;width:60px"><img src="myimg.jspx?path=${message.user.imgname}" style="width:60px;height:65px" /></div>
															</c:otherwise>
														</c:choose>
														  <div class = "left " id="${message.id}" style="width:200px;height:100px;border:1px solid grey;position:absolute;z-index:1;margin-left:40px;margin-top:-30px;background-color:grey"  OnMouseOver="player('${message.id}');" onMouseOut="clocer('${message.id}');">
															<div style="margin-left:2px;width:60px">
															<c:choose>
																<c:when test="${empty message.user.imgname}">
																	<div class="wall" style="border:grey solid 1px;width:50px"><img src="img/4.png" style="width:60px;height:75px"  /></div>
																</c:when>
																<c:otherwise>
																	<div class="wall" style="border:grey solid 1px;width:60px"><img src="myimg.jspx?path=${message.user.imgname}" style="width:60px;height:75px"  /></div>
																</c:otherwise>
															</c:choose>
															</div>
															<div style="margin-left:22px;color:yellow">${message.user.username}</div>
														</div>
													</div>
												</div>
												  <div class="span4">
													<div style="width:370px;border-left:none;word-wrap:break-word">
														<div style="margin-left:8px;margin-right:10px"><span style="color:green;font-size:16px">${message.user.username}</span><span>    新建了任务:</span><a href="goal.jspx?pmothed=alltask">  &lt: ${message.name} &gt:  </a><span style="margin-left:8px"><a href="goal.jspx?pmothed=alltask">${message.content}</a></span></div>
														<div style="margin-left:8px;margin-top:5px"><span style="margin-left:8px">${message.date}</span></div><hr>
													</div>
												  </div>
											</div>
										</c:when>
										<c:when test="${message.type=='goal'}" >
											<div class="row" style="margin-bottom:10px;border-radius: 3px 3px 0 0;margin-top:0px">						 
												   <div class="span1" OnMouseOver="player('${message.id}');" onMouseOut="clocer('${message.id}');" >
													<div style="margin-left:20px;width:60px">
														<c:choose>
															<c:when test="${empty message.user.imgname}">
																<div class="wall" style="border:grey solid 1px;width:50px"><img src="img/4.png" style="width:60px;height:65px"  /></div>
															</c:when>
															<c:otherwise>
																<div class="wall" style="border:grey solid 1px;width:60px"><img src="myimg.jspx?path=${message.user.imgname}" style="width:60px;height:65px" /></div>
															</c:otherwise>
														</c:choose>
														  <div class = "left " id="${message.id}" style="width:200px;height:100px;border:1px solid grey;position:absolute;z-index:1;margin-left:40px;margin-top:-30px;background-color:grey"  OnMouseOver="player('${message.id}');" onMouseOut="clocer('${message.id}');">
															<div style="margin-left:2px;width:60px">
															<c:choose>
																<c:when test="${empty message.user.imgname}">
																	<div class="wall" style="border:grey solid 1px;width:50px"><img src="img/4.png" style="width:60px;height:75px"  /></div>
																</c:when>
																<c:otherwise>
																	<div class="wall" style="border:grey solid 1px;width:60px"><img src="myimg.jspx?path=${message.user.imgname}" style="width:60px;height:75px"  /></div>
																</c:otherwise>
															</c:choose>
															</div>
															<div  style="margin-left:22px;color:yellow">${message.user.username}</div>
														</div>
													</div>
												  </div>
												  <div class="span4">
													<div style="width:370px;border-left:none;word-wrap:break-word">
														<div style="margin-left:8px;margin-right:10px"><span style="color:green;font-size:16px">${message.user.username}</span><span>   新建了目标:</span><a href="goal.jspx">  &lt: ${message.name} &gt:  </a><span style="margin-left:8px"><a href="goal.jspx">${message.content}</a></span></div>
														<div style="margin-left:8px;margin-top:5px"><span style="margin-left:8px">${message.date}</span></div><hr>
													</div>
												  </div>
											</div>
										</c:when>
										<c:otherwise >
											<div class="row" style="margin-bottom:10px;border-radius: 3px 3px 0 0;margin-top:0px">						 
												   <div class="span1" OnMouseOver="player('${message.id}');" onMouseOut="clocer('${message.id}');" >
													<div style="margin-left:20px;width:60px">
														<c:choose>
															<c:when test="${empty message.user.imgname}">
																<div class="wall" style="border:grey solid 1px;width:50px"><img src="img/4.png" style="width:60px;height:65px"  /></div>
															</c:when>
															<c:otherwise>
																<div class="wall" style="border:grey solid 1px;width:60px"><img src="myimg.jspx?path=${message.user.imgname}" style="width:60px;height:65px"  /></div>
															</c:otherwise>
														</c:choose>
														  <div class = "left " id="${message.id}" style="width:200px;height:100px;border:1px solid grey;position:absolute;z-index:1;margin-left:40px;margin-top:-30px;background-color:grey"  OnMouseOver="player('${message.id}');" onMouseOut="clocer('${message.id}');">
															<div style="margin-left:2px;width:60px">
															<c:choose>
																<c:when test="${empty message.user.imgname}">
																	<div class="wall" style="border:grey solid 1px;width:50px"><img src="img/4.png" style="width:60px;height:75px"  /></div>
																</c:when>
																<c:otherwise>
																	<div class="wall" style="border:grey solid 1px;width:60px"><img src="myimg.jspx?path=${message.user.imgname}" style="width:60px;height:75px"  /></div>
																</c:otherwise>
															</c:choose>
															</div>
															<div style="margin-left:22px;color:yellow">${message.user.username}</div>
														</div>
													</div>
												  </div>
												  <div class="span4">
													<div style="width:370px;border-left:none;word-wrap:break-word">
														<div style="margin-left:8px;margin-right:10px"><span style="color:green;font-size:16px">${message.user.username}</span><span>   发表了想法:</span><a href="idea.jspx">  &lt: ${message.name} &gt:  </a><span><a href="idea.jspx">${message.content}</a></span></div>
														<div style="margin-left:8px;margin-top:5px"><span style="margin-left:8px">${message.date}</span></div>	
														<c:forEach items = "${message.commentlist}" var = "comment">
															<div style="margin-left:15px;margin-top:5px"><span ><i class="icon-user "></i> <a href="idea.jspx">${comment.userid}</a>:   ${comment.content}</span>  </div>
														</c:forEach>
													</div>
													<hr>
												  </div>
											  </div>
											</c:otherwise>
										</c:choose>
									</c:forEach>
							  </c:otherwise>
						</c:choose>
					</div>
					<div style ="clear:both"></div>                                                                                                                                                                                                             	
						<div style="margin-top:2px;margin-right:10px"  class="pagination pull-right">
					 <ul>
					<c:choose>
						<c:when test="${ requestScope.messagelist.totalPage == 1}">
							
						</c:when>
						<c:when test="${ requestScope.messagelist.totalPage > 1}">
							<c:choose>
							<c:when test="${messagelist.pageNum == 1}">
								<li><a href="#">Prev</a></li>
								<li class = "active"><a>1</a></li>
								<li ><a href = "pro.jspx?q=2">2</a></li>
								<li><a>...</a></li>	
								<li><a href="#">Next</a></li>			
							</c:when>
							<c:when test="${messagelist.pageNum == 2}">
								<li><a href="pro.jspx?q=${messagelist.pageNum-1}">Prev</a></li>
								<li ><a href = "pro.jspx?q=1">1</a></li>
								<li class = "active"><a href = "pro.jspx?q=2">2</a></li>
								<li><a>...</a></li>
								<c:choose>
								<c:when test="${messagelist.pageNum == messagelist.totalPage }">
									<li><a href="#">Next</a></li>
								</c:when>
								<c:otherwise>
									<li><a href="pro.jspx?q=${messagelist.pageNum+1}">Next</a></li>
								</c:otherwise>
								</c:choose>				
							</c:when>	
							<c:when test="${messagelist.pageNum > 2}">
								<li><a href="pro.jspx?q=${messagelist.pageNum-1}">Prev</a></li>
								<li ><a href = "pro.jspx?q=1">1</a></li>
								<li ><a href = "pro.jspx?q=2">2</a></li>
								<li><a>...</a></li>	
								<li class = "active"><a >${messagelist.pageNum}</a></li>
								<c:choose>
								<c:when test="${messagelist.pageNum == messagelist.totalPage }">
									<li><a href="#">Next</a></li>
								</c:when>
								<c:otherwise>
									<li><a href="pro.jspx?q=${messagelist.pageNum+1}">Next</a></li>
								</c:otherwise>
								</c:choose>		
							</c:when>	
							</c:choose>	
						</c:when>
					</c:choose>	
					<li><a>共${messagelist.totalPage}页</a></li>
					</ul></div>
				  </div>
				  <div class="tab-pane" id="profile">
				  	<c:choose>
						<c:when test="${empty requestScope.meList.list}">
							<div>
								<div style="margin-left:20px">该项目还没有关于我的任何动态</div>
							</div>
						</c:when>
						<c:otherwise>
							<c:forEach items = "${requestScope.meList.list}" var="atmessage">
								<div class="row" style="margin-bottom:10px;border-radius: 3px 3px 0 0;margin-top:0px">						 
								   	<div class="span2" >
								   	</div>
								  	<div class="span4">
										<div style="width:350px;border-left:none;word-wrap:break-word;margin-left:50px">
											<div style="margin-left:20px;margin-right:10px"><span style="color:green;font-size:16px">${atmessage.message.user.username}    :</span><span><a href="#">${atmessage.message.content}</a></span></div>
											<div style="margin-left:8px;margin-top:5px"><span style="margin-left:8px">发布于${atmessage.message.date}</span></div>
										</div>
										<div style="width:350px;margin-left:58px"><hr></div>
								   </div>
								</div> 
							</c:forEach>
							
						</c:otherwise>
					</c:choose>
					<div style ="clear:both"></div>                                                                                                                                                                                                             	
						<div style="margin-top:2px;margin-right:10px"  class="pagination pull-right">
					 <ul>
					<c:choose>
						<c:when test="${ requestScope.meList.totalPage == 1}">
							
						</c:when>
						<c:when test="${ requestScope.meList.totalPage > 1}">
							<c:choose>
							<c:when test="${meList.pageNum == 1}">
								<li><a href="#">Prev</a></li>
								<li class = "active"><a>1</a></li>
								<li ><a href = "pro.jspx?p=2">2</a></li>
								<li><a>...</a></li>	
								<li><a href="#">Next</a></li>			
							</c:when>
							<c:when test="${meList.pageNum == 2}">
								<li><a href="pro.jspx?p=${meList.pageNum-1}">Prev</a></li>
								<li ><a href = "pro.jspx?p=1">1</a></li>
								<li class = "active"><a href = "pro.jspx?p=2">2</a></li>
								<li><a>...</a></li>
								<c:choose>
								<c:when test="${meList.pageNum == meList.totalPage }">
									<li><a href="#">Next</a></li>
								</c:when>
								<c:otherwise>
									<li><a href="pro.jspx?p=${meList.pageNum+1}">Next</a></li>
								</c:otherwise>
								</c:choose>				
							</c:when>	
							<c:when test="${meList.pageNum > 2}">
								<li><a href="pro.jspx?p=${meList.pageNum-1}">Prev</a></li>
								<li ><a href = "pro.jspx?p=1">1</a></li>
								<li ><a href = "pro.jspx?p=2">2</a></li>
								<li><a>...</a></li>	
								<li class = "active"><a >${meList.pageNum}</a></li>
								<c:choose>
								<c:when test="${meList.pageNum == meList.totalPage }">
									<li><a href="#">Next</a></li>
								</c:when>
								<c:otherwise>
									<li><a href="pro.jspx?p=${meList.pageNum+1}">Next</a></li>
								</c:otherwise>
								</c:choose>		
							</c:when>	
							</c:choose>	
						</c:when>
					</c:choose>	
					<li><a>共${meList.totalPage}页</a></li>
					</ul></div>
				  </div>
				</div>
			  </div> 
			  
			</div>
			
			<div class="span3" style="margin-top:10px">
				<div style="border:1px  solid #dddddd">
					<legend><strong>我的任务</strong></legend>
					<c:choose>
					<c:when test="${empty requestScope.taskList}">
						你目前还没有任务
					</c:when>
					<c:otherwise>
						<ul  class="well" style="margin:5px">
							<c:forEach items = "${requestScope.taskList }" var = "task">
								<li style="margin-left:5px">
									<span style="font-size:14px;font-weight:bold">[${task.name}]</span><a href="goal.jspx?pmothed=mytask">[查看详细]</a>
									<div style="margin-left:8px">结束日期：${task.endtime}</div>
									<div style="margin-left:8px">紧急程度：${task.isImport}</div>
								</li><hr>
							</c:forEach>
						</ul>
					</c:otherwise>
				</c:choose>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#myid li").eq(2).addClass("active");
			$("#myid i").eq(0).addClass("icon-white");
			/*$(".btn").click(function(){
				var r=document.getElementById("des").value;
				alert(r);
				$(".myform").submit();
				
			});
			$(".comment").click(function(){
				$(".mydiv :hidden").show();
			});
			
			$("#btn").click(function(){
				$(".mydiv :visible").hidden();
			});*/
			
		});
		function player(id){
			 var id=document.getElementById(id);
			id.style.display="block"; 
			
		}
		function clocer(id){
			 var id=document.getElementById(id);
			id.style.display="none"; 
			
		}
		function comment(id){
			 var id=document.getElementById(id);
			id.submit();
		}
			
		
		
	</script>
	
</body>
</html>
